package cn.tedu;

import java.util.Scanner;

/*本类用于面向对象汽车案例*/
public class Car {
    public static void main(String[] args) {
        System.out.println("请输入数字：");
        int q = new Scanner(System.in ).nextInt();
        DesignCar d = new DesignCar();
        d.setColor("长虹白");
        d.setBrand("迈巴赫");
        System.out.println(d.getBrand());
        System.out.println(d.getColor());
        Cadillac c = new Cadillac();
        c.setPrice(23456545.2565);
        System.out.println(c.getPrice());
        c.Navigation();
        c.start();
        c.stop();
        Benz a = new Benz();
        a.voice();
        DesignCar b = new Benz();
        b.setPrice(121425.41);
        b.setId(11111);
        System.out.println(b.getPrice());
        System.out.println(b.getId());
        b.start();

/*        DesignCar d= new Benz();
        d.setId(11);
        System.out.println(d.getId());
        Cadillac c = new Cadillac();
        c.stop();*/
    }
}
class DesignCar{
    static {
        System.out.println("大家好，我是汽车第一个显示的话，666");
    }
    private String brand;
    private String color;
    private double price;
    private int id;

    public void stop(){
        System.out.println("我想停，谁也拦不住！！！");
    }

    public void start(){
        System.out.println("我要启动了，都给我让开国际跑道！！！");
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
class Cadillac extends DesignCar{
    int a = 500;
    public void Navigation(){
        System.out.println(a+"元,想去哪里和我说");
    }
    @Override
    public void stop(){
        System.out.println("谁也拦不住！！！");
    }
}
class Benz extends DesignCar{
    public void voice(){
        System.out.println("我是你的语音助手，你可以叫我：大哥");
    }

}